package main

import (
	"fmt"
)

func destCity(paths [][]string) string {
	cachs := map[string]int{}
	l := len(paths)
	result := ""
	for i := 0; i < l; i++ {
		//if _,s:=cachs[paths[i][0]];!s{
		cachs[paths[i][0]] = 0
		//}
		if _, s := cachs[paths[i][1]]; !s {
			cachs[paths[i][1]] = 1
		}
		//cachs[paths[i][0]] = false
	}
	fmt.Println(cachs)
	for i := range cachs {
		fmt.Println(i)
		if cachs[i] == 1 {
			return i
		}
	}
	return result
}

func main() {
	paths := [][]string{{"London", "New York"}, {"New York", "Lima"}, {"Lima", "Sao Paulo"}}
	result := destCity(paths)
	fmt.Println(result)
}
